﻿<%@ Page Title="" Language="VB" MasterPageFile="~/bo/BOMaster.master" AutoEventWireup="false" CodeFile="SearchEditCustomer.aspx.vb" Inherits="bo_SearchEditCustomer" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script type="text/javascript">
        var SubPage = {};
        SubPage.SearchBy = "<%= SearchBy %>";
        SubPage.SearchStr = "<%= SearchStr %>";
        SubPage.Init = function () {
            jQuery("#list1").jqGrid({
                url: 'handlers/SearchEditCustomer.ashx?searchby=' + SubPage.SearchBy + '&searchstr=' + SubPage.SearchStr,
                datatype: "xml",
                colNames: ['ID', 'Email', 'Mobile', 'Customer Name'],
                colModel: [
   		                { name: 'id', index: 'id', width: 40, align: "center" },
   		                { name: 'email', index: 'email', width: 150 },
   		                { name: 'mobile', index: 'mobile', width: 150 },
   		                { name: 'custname', index: 'custname', width: 200 }
   	        ],
                rowNum: 10,
                autowidth: true,
                rowList: [10, 20, 30],
                pager: jQuery('#pager1'),
                sortname: 'id',
                viewrecords: true,
                sortorder: "desc",
                caption: "Search result",
                ondblClickRow: function (id) { SubPage.LoadCustDetails($("#list1").jqGrid('getRowData',id).id); 
                },
            }).navGrid('#pager1', { edit: false, add: false, del: false });
        }
    SubPage.LoadCustDetails = function (CustID) {
        $("#ContentPlaceHolder1_hfldCustID").val(CustID);
        __doPostBack("ctl00$ContentPlaceHolder1$btnShowCustDetails","");
    }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:HiddenField ID="hfldCustID" runat="server" />
 <asp:LinkButton ID="btnShowCustDetails" runat="server" CssClass="hide">LinkButton</asp:LinkButton>
 <div class="searchbar">
    Search customer 
     <asp:DropDownList ID="ddSearchBy" runat="server">
         <asp:ListItem Selected="True" Value="Email">Email ID</asp:ListItem>
         <asp:ListItem Value="Mobile">Mobile Number</asp:ListItem>
         <asp:ListItem Value="LastName">Last Name</asp:ListItem>
         <asp:ListItem Value="FirstName">First Name</asp:ListItem>
     </asp:DropDownList>
     <asp:TextBox ID="txtStr" runat="server"></asp:TextBox>
     <asp:Button ID="btnSearch" runat="server" Text="Search" />
 </div>
 <div id="searchtabl" style="margin-top:20px; width:700px">
    <table id="list1"></table>
    <div id="pager1"></div>
 </div>
 <asp:Panel runat="server" ID="panelDetails" Visible="false">
 <div id="custDetails" class="custdetails">
    <table style="width:100%">
        <tbody>
            <tr>
                <td colspan="4" class="lblHeader">Customer details</td>
            </tr>
            <tr>
                <td class="lblnames">DateTime</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblDateTime"></asp:Label></td>
                <td class="lblnames">Status</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblStatus"></asp:Label><asp:Button runat="server" ID="btnStatus" Text="" /></td>
            </tr>
            <tr>
                <td class="lblnames">Username</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblUsername"></asp:Label></td>
                <td class="lblnames">Password</td>
                <td class="lblvalue">xxxx</td>
            </tr>
            <tr>
                <td class="lblnames">First name</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblFirstName"></asp:Label></td>
                <td class="lblnames">Last name</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblLastName"></asp:Label></td>
            </tr>
            <tr>
                <td class="lblnames">Email id</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblEmail"></asp:Label></td>
                <td class="lblnames">Mobile No</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblMobile"></asp:Label></td>
            </tr>
            <tr>
                <td class="lblnames">Address</td>
                <td class="lblvalue" colspan="3"><asp:Label runat="server" ID="lblAddress"></asp:Label></td>
            </tr>
            <tr>
                <td class="lblnames">City</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblCity"></asp:Label></td>
                <td class="lblnames">State</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblState"></asp:Label></td>
            </tr>
            <tr>
                <td class="lblnames">Country</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblCountry"></asp:Label></td>
                <td class="lblnames">Pin</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblPin"></asp:Label></td>
            </tr>
            <tr>
                <td colspan="4" class="lblHeader">Subscription details</td>
            </tr>
            <tr>
                <td class="lblnames">Subscription Type</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblSubType"></asp:Label></td>
                <td class="lblnames">Days left</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblSubDays"></asp:Label></td>
            </tr>
            <tr>
                <td class="lblnames">Start date</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblSubStart"></asp:Label></td>
                <td class="lblnames">End date</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblSubEnd"></asp:Label></td>
            </tr>
            <tr>
                <td class="lblnames">Payment</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblSubAmount"></asp:Label></td>
                <td class="lblnames">Status</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblSubAmountStatus"></asp:Label></td>
            </tr>
        </tbody>
    </table>
 </div>
   </asp:Panel>
    
</asp:Content>

